package com.company.test20;

import java.io.File;

/**
 * Created by Administrator on 2016.9.24.
 */
public class Test20_07 {

    public static long getSize(File file){
        long size=0;

        if(file.isDirectory()){
            File[] files=file.listFiles();

            for(int i=0;i<files.length;i++){
                size+=getSize(files[i]);
            }
        }else {
            size+=file.length();
        }

        return size;
    }

    public static void main(String[] args) {
        System.out.println(getSize(new File("src")));
    }
}